<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                template="./../../template/templateSGPF.xhtml"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:pe="http://primefaces.org/ui/extensions">

    <ui:define name="corpo da página">
        <script>
            function decideMessage(value) {
                if (value) {
                    if (value.dialogConfimation === 'salvar') {
                        PF('save').show();
                    }
                    if (value.dialogConfimation === 'update') {
                        update.show();
                    }
                    if (value.dialogConfimation === 'error') {
                        error.show();
                    }
                }
            }
            function verify(value) {
                if (value.flag === "salvar") {
                    PF('confirmacao').show();
                }
                if (value.flag === "ok") {
                    PF('save').show();
                }
                if (value.flag === "nok") {
                    PF('notfilled').show();
                }
                if (value.flag === "nocep") {
                    PF('errorcep').show();
                }
            }
            function disableConfirm() {
                $('[id=\'conteudo:confirm\']').attr('disabled', 'true');
            }
            function disableDecline() {
                $('[id=\'conteudo:decline\']').attr('disabled', 'true');
            }

            function removerEspacos(inputtext) {
                inputtext.value = inputtext.value.replace(/^\s+|\s+$/g, "");
            }

            function alteraMaiusculo(inputtext) {
                inputtext.value = inputtext.value.toUpperCase();
            }
        </script>

        <center><h1>#{servidorBean.titulo} </h1></center>
        <h:form id="frmCadPessoal" prependId="false">
            <div class="row-fluid"> 
                <p:messages for="msgServCad" showDetail="true" autoUpdate="true" closable="true" />                                            
            </div>
            <div class="row-fluid">
                <div class="pull-right">                      
                    <p:commandButton style="width: 100px;"
                                     value="Salvar" 
                                     update=":formCampos :formConfirm"
                                     icon="ui-icon-disk"
                                     oncomplete="verify(args);"
                                     action="#{servidorBean.verificaCamposDialog()}"
                                     disabled="#{servidorBean.habilitaSalvar}"
                                     />
                    <p:commandButton style="width: 100px;" 
                                     icon="ui-icon-circle-close"
                                     value="Cancelar" 
                                     action="#{servidorBean.cancelar()}"
                                     ajax="false"
                                     update=":frmCadPessoal"/>
                </div>
            </div>

            <p:tabView id="tabView" activeIndex="#{servidorBean.indexTab}">
                <p:tab title="Dados Pessoais" id="idtab1" disabled="#{servidorBean.tab1}"  >
                    <div class="row-fluid">
                        <div class="span6">
                            <div class="well-custom">

                                <div class="row-fluid" >
                                    <strong for="Nome" class="font-color-green">
                                        Nome<strong style="color:red">*</strong>:</strong> 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:inputText id="txt_nome" style="width: 97%; height: 30px;"
                                                     value="#{servidorBean.servidor.nome}" 
                                                     class="form-control"
                                                     onkeyup="alteraMaiusculo(this)"/>                                
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgNome" showDetail="true" autoUpdate="true" closable="true"/>                                           
                                    </div>
                                </div>

                                <div class="row-fluid">                                       
                                    <strong for="txtFone" class="font-color-green">
                                        CEP:</strong>                                 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:inputMask id="txt_cep" style="width: 46%; height: 30px; "
                                                     mask="99999-999"
                                                     value="#{servidorBean.cep}"
                                                     title="Digite o cep e clique em localizar para buscar um endereço."/>
                                        <p:commandButton value="Localizar"
                                                         icon="ui-icon-check"
                                                         action="#{servidorBean.encontraCEP()}"
                                                         update=":frmCadPessoal"
                                                         oncomplete="verify(args);"
                                                         onclick="PF('statusDialog').show();"
                                                         onsuccess="PF('statusDialog').hide();"
                                                         style="margin-bottom: 10px; width: 100px; height: 30px; left: 4%"/>
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgCEP" showDetail="true" autoUpdate="true" closable="true" />                                
                                    </div>
                                </div>                                

                                <div class="row-fluid">
                                    <strong for="txtNome" class="font-color-green">
                                        Endereco:</strong>                                 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:inputText id="txt_endereco" style="width: 97%; height: 30px;"
                                                     value="#{servidorBean.servidor.endereco}"
                                                     onkeyup="alteraMaiusculo(this)"/>                                
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgEndereco" showDetail="true" autoUpdate="true" closable="true"/>                                           
                                    </div>
                                </div>

                                <div class="row-fluid">                                       
                                    <strong for="txtFone" class="font-color-green">
                                        Telefone:</strong>                                 
                                    <strong for="txtFone" class="font-color-green" 
                                            style="margin-left: 15%">
                                        Telefone2:</strong>                                 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:inputMask id="txt_telefone" style="width: 47%; height: 30px; "
                                                     mask="(99) 9999-9999"
                                                     value="#{servidorBean.servidor.telefone}"/>                                
                                        <p:inputMask id="txt_telefone2" style="width: 47%; height: 30px; margin-left: 3% "
                                                     mask="(99) 9999-9999"
                                                     value="#{servidorBean.servidor.telefone2}"/>                                
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgFone" showDetail="true" autoUpdate="true" closable="true" />                                
                                    </div>
                                </div>

                            </div>                                
                        </div>

                        <div class="span6">
                            <div class="well-custom">
                                <div class="row-fluid">                                       
                                    <strong for="txtEstado" class="font-color-green">
                                        Estado: </strong>                                 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:autoComplete id="sloEstado" 
                                                        value="#{servidorBean.servidor.uf}" 
                                                        completeMethod="#{servidorBean.autoCompleteEstado}" 
                                                        var="estado" itemLabel="#{estado.nome}  #{estado.uf}" 
                                                        itemValue="#{estado}" converter="estadoConverter"
                                                        style="width: 97%; height: 30px; color: blue;"                                                        
                                                        >
                                            <p:column style="font-size: 17px;">
                                                #{estado.nome}
                                            </p:column>
                                        </p:autoComplete>

                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgEstado" showDetail="true" autoUpdate="true" closable="true" />                                
                                    </div>
                                </div>
                                <div class="row-fluid" style="margin-top: 1%">                                       
                                    <strong for="txtAcao" class="font-color-green">
                                        Município: </strong>                                 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:autoComplete id="sloMunicipio" 
                                                        value="#{servidorBean.servidor.cidade}" 
                                                        completeMethod="#{servidorBean.autoCompleteMunicipio}" 
                                                        var="municipio" itemLabel="#{municipio.nome}  #{municipio.estadoId.uf}" 
                                                        itemValue="#{municipio}" converter="municipioConverter"
                                                        style="width: 97%; height: 30px; "                                                        
                                                        >
                                            <p:column style="font-size: 17px; color: blue;">
                                                #{municipio.nome}
                                            </p:column>
                                        </p:autoComplete>
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgMunicípio" showDetail="true" autoUpdate="true" closable="true" />                                
                                    </div>
                                </div>

                                <div class="row-fluid" style="margin-top: 2%">                                       
                                    <strong for="txtAcao" class="font-color-green">
                                        Bairro:</strong>                                 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:autoComplete id="sloBairro" 
                                                        value="#{servidorBean.servidor.bairro}" 
                                                        completeMethod="#{servidorBean.autoCompleteBairro}" 
                                                        var="bairro" itemLabel="#{bairro.nome}" 
                                                        itemValue="#{bairro}" converter="bairroConverter"
                                                        style="width: 97%; height: 30px; color: blue;"                                                        
                                                        >
                                            <p:column style="font-size: 17px; color: blue;">
                                                #{bairro.nome}
                                            </p:column>
                                        </p:autoComplete>
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgBairro" showDetail="true" autoUpdate="true" closable="true" />                                
                                    </div>
                                </div>

                                <div class="row-fluid" style="margin-top: 2%">
                                    <strong for="txtPopulacao" class="font-color-green">
                                        Escolaridade: </strong> 
                                    <strong for="txtPopulacao" 
                                            class="font-color-green"
                                            style="margin-left: 12%">
                                        Sexo: </strong> 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:selectOneMenu id="sloEscolaridade"  
                                                         style="width: 47%; color: black;"
                                                         value="#{servidorBean.servidor.escolaridade}"
                                                         onkeyup="alteraMaiusculo(this)">
                                            <f:selectItem itemLabel="Fundamental" itemValue="FUNDAMENTAL"
                                                          class="font-color-black"/>
                                            <f:selectItem itemLabel="Médio" itemValue="MEDIO" 
                                                          class="font-color-black"/>
                                            <f:selectItem itemLabel="Superior" itemValue="SUPERIOR"
                                                          class="font-color-black"/>
                                        </p:selectOneMenu>
                                        <p:selectOneMenu id="sloSexo"  
                                                         style="width: 47%; color: black; margin-left: 2%"
                                                         value="#{servidorBean.servidor.sexo}"
                                                         onkeyup="alteraMaiusculo(this)">
                                            <f:selectItem itemLabel="MASCULINO" itemValue="M"
                                                          class="font-color-black"/>
                                            <f:selectItem itemLabel="FEMININO" itemValue="F" 
                                                          class="font-color-black"/>
                                        </p:selectOneMenu>
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgEscolaridade" showDetail="true" autoUpdate="true" closable="true"/>                                           
                                    </div>
                                </div>                                  
                            </div>
                        </div>

                        <div class="pull-right">
                            <p:commandButton value="Próximo"                                                  
                                             update=":frmCadPessoal"
                                             style=" width: 100px;"
                                             icon="ui-icon-arrowthick-1-e"
                                             >
                                <f:actionListener binding="#{servidorBean.proximo()}"/>
                            </p:commandButton>
                        </div>

                    </div>

                </p:tab>
                <p:tab title="Dados Complementares" id="idtab2" disabled="#{servidorBean.tab2}">
                    <div class="row-fluid">
                        <div class="span6">
                            <div class="well-custom">
                                <div class="row-fluid">                                       
                                    <strong for="txtFone" class="font-color-green">
                                        RG<strong style="color:red">*</strong>:</strong>                                 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:inputText id="txt_rg" style="width: 97%; height: 30px;  "                                                     
                                                     value="#{servidorBean.servidor.rg}"
                                                     maxlength="7"/>
                                        <pe:keyFilter for="txt_rg" mask="num"/>
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgRG" showDetail="true" autoUpdate="true" closable="true" />                                
                                    </div>
                                </div>
                                <div class="row-fluid">                                       
                                    <strong for="txtCPF" class="font-color-green">
                                        CPF<strong style="color:red">*</strong>:</strong>                                 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:inputMask id="txt_CPF" style="width: 97%; height: 30px; "
                                                     mask="999.999.999-99"
                                                     value="#{servidorBean.servidor.cpf}"/>                                
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgCpf" showDetail="true" autoUpdate="true" closable="true" />                                
                                    </div>
                                </div>
                                <div class="row-fluid">                                       
                                    <strong for="txtPIS" class="font-color-green">
                                        PIS/PASEP<strong style="color:red">*</strong>:</strong>                                 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:inputText id="txt_pis" style="width: 97%; height: 30px; "
                                                     value="#{servidorBean.servidor.pisPasep}"
                                                     maxlength="13"
                                                     title="Digite o número do pis "
                                                     label="pis"
                                                     />
                                        <pe:keyFilter for="txt_pis" mask="num"/>  
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgPIS" showDetail="true" autoUpdate="true" closable="true" />                                
                                    </div>
                                </div>
                                <div class="row-fluid">                                       
                                    <strong for="txtStatus" class="font-color-green">
                                        Título <strong style="color:red">*</strong>:</strong>                                 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:inputText id="txt_titulo" style="width: 97%; height: 30px; "
                                                     value="#{servidorBean.servidor.titulo}"
                                                     maxlength="13"/>
                                        <pe:keyFilter for="txt_titulo" mask="num"/>
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgTitulo" showDetail="true" autoUpdate="true" closable="true" />                                
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="span6">
                            <div class="well-custom">
                                <div class="row-fluid" >
                                    <strong for="sloCargo" class="font-color-green">Cargo<strong style="color:red">*</strong>:</strong> 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:selectOneMenu id="sloCargo" 
                                                         style="width: 97%; color: black"
                                                         value="#{servidorBean.servidor.cargo}"
                                                         filter="true"
                                                         filterMatchMode="startsWith"
                                                         converter="cargoConverter"
                                                         >
                                            <f:selectItem itemLabel="Selecione o cargo" itemValue="" />
                                            <f:selectItems value="#{servidorBean.cargos}"
                                                           var="cargo"
                                                           itemValue="#{cargo}"
                                                           itemLabel="#{cargo.nome}"
                                                           class="font-color-black"
                                                           />
                                        </p:selectOneMenu>
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgCargo" showDetail="true" autoUpdate="true" closable="true"/>                                           
                                    </div>
                                </div>

                                <div class="row-fluid" style="margin-top: 2%">
                                    <strong for="Classific" class="font-color-green">
                                        Tipo de cargo <strong style="color:red">*</strong>:</strong> 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:selectOneMenu id="sloClassificacao"  
                                                         style="width: 97%; color: black;"
                                                         value="#{servidorBean.servidor.tipoDeCargo}"
                                                         converter="tipocargoConverter">
                                            <f:selectItem itemLabel="Selecione" itemValue=""
                                                          class="font-color-black"/>
                                            <f:selectItems value="#{servidorBean.tipocargos}"
                                                           var="tpcargo"
                                                           itemValue="#{tpcargo}"
                                                           itemLabel="#{tpcargo.tipo}"
                                                           class="font-color-black"
                                                           />
                                        </p:selectOneMenu>
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgTipoCargo" showDetail="true" autoUpdate="true" closable="true"/>                                           
                                    </div>
                                </div>

                                <div class="row-fluid" style="margin-top: 2%">
                                    <strong for="sloMunicipio" class="font-color-green">Profissão: </strong> 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:inputText id="txt_profissao" style="width: 97%; height: 30px; "
                                                     value="#{servidorBean.servidor.profissao}"
                                                     onkeyup="alteraMaiusculo(this)"
                                                     />                                        
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgProfissao" showDetail="true" autoUpdate="true" closable="true"/>                                           
                                    </div>
                                </div>

                                <div class="row-fluid">                                       
                                    <strong for="txtStatus" class="font-color-green">
                                        Vínculo Previdência<strong style="color:red">*</strong>:</strong>                                 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:selectOneMenu id="sloVinculo"  
                                                         style="width: 97%; color: black;"
                                                         value="#{servidorBean.servidor.vincPrevidencia}">
                                            <f:selectItem itemLabel="Selecione" itemValue="" />
                                            <f:selectItem itemLabel="INSS" itemValue="INSS"
                                                          class="font-color-black"/>
                                            <f:selectItem itemLabel="FUNPREV" itemValue="FUNPREV"
                                                          class="font-color-black"/>
                                            <f:selectItem itemLabel="FINAPREV" itemValue="FINAPREV"
                                                          class="font-color-black"/>
                                        </p:selectOneMenu>
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgPrevidencia" showDetail="true" autoUpdate="true" closable="true" />                                
                                    </div>
                                </div>

                            </div>
                        </div>
                        <div class="pull-left">
                            <p:commandButton value="Voltar"                                                  
                                             update=":frmCadPessoal"
                                             style=" width: 100px;"
                                             icon="ui-icon-arrowthick-1-w"
                                             >
                                <f:actionListener binding="#{servidorBean.voltar()}"/>
                            </p:commandButton>
                        </div>

                        <div class="pull-right">
                            <p:commandButton value="Próximo"                                                  
                                             update=":frmCadPessoal"
                                             style=" width: 100px;"
                                             icon="ui-icon-arrowthick-1-e"
                                             >
                                <f:actionListener binding="#{servidorBean.proximo()}"/>
                            </p:commandButton>
                        </div>

                    </div>  

                </p:tab>
                <p:tab title="Lotação/Unidade" id="idtab3" disabled="#{servidorBean.tab3}">
                    <div class="row-fluid" >
                        <div class="span6">
                            <div class="well-custom">
                                <div class="row-fluid" >
                                    <strong for="sloUnidade" class="font-color-green">
                                        Unidade:</strong> 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:selectOneMenu id="sloUnidade" 
                                                         style="width: 97%; color: black"
                                                         value="#{servidorBean.servidor.unidade}"
                                                         filter="true"
                                                         filterMatchMode="startsWith"
                                                         converter="unidadeConverter"
                                                         >
                                            <f:selectItem itemLabel="Selecione a Unidade" itemValue="" />
                                            <f:selectItems value="#{servidorBean.unidades}"
                                                           var="unidade"
                                                           itemValue="#{unidade}"
                                                           itemLabel="#{unidade.sigla}"
                                                           class="font-color-black"/>
                                            <p:ajax listener="#{servidorBean.selecionaSetorUnidade()}" update="sloSetor"/> 
                                        </p:selectOneMenu>
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgUnidade" showDetail="true" autoUpdate="true" closable="true"/>                                           
                                    </div>
                                </div>

                                <div class="row-fluid" style="margin-top: 2%">
                                    <strong for="sloSetor" class="font-color-green">Setor:</strong> 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:selectOneMenu id="sloSetor" 
                                                         style="width: 97%; color: black;"
                                                         value="#{servidorBean.servidor.setor}"
                                                         filter="true"
                                                         filterMatchMode="startsWith"
                                                         converter="setorConverter"
                                                         >
                                            <f:selectItem itemLabel="Selecione o Setor" itemValue="" />
                                            <f:selectItems value="#{servidorBean.setorUnidade}"
                                                           var="setor"
                                                           itemValue="#{setor}"
                                                           itemLabel="#{setor.sigla}"
                                                           class="font-color-black"/>
                                        </p:selectOneMenu>
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgSetor" showDetail="true" autoUpdate="true" closable="true"/>                                           
                                    </div>
                                </div>

                                <div class="row-fluid" style="margin-top: 2%">                                       
                                    <strong for="txtFuncao" class="font-color-green">
                                        Função <strong style="color:red">*</strong>:</strong>                                 
                                </div>
                                <div class="row-fluid" >
                                    <div class="span6">
                                        <p:inputText id="txt_funcao" style="width: 97%; height: 30px; "
                                                     value="#{servidorBean.servidor.funcao}"
                                                     onkeyup="alteraMaiusculo(this)"
                                                     />                                    
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgFuncao" showDetail="true" autoUpdate="true" closable="true" />                                
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="span6">
                            <div class="well-custom">
                                <div class="row-fluid">                                       
                                    <strong for="txtFuncao" class="font-color-green">
                                        Data de admissão <strong style="color:red">*</strong>:</strong>                                 
                                </div>
                                <div class="row-fluid" >
                                    <div class="span6">
                                        <p:calendar id="dataAdm"  
                                                    value="#{servidorBean.servidor.dataAdmissao}" 
                                                    locale="pt" 
                                                    showButtonPanel="true" 
                                                    navigator="true" 
                                                    yearRange="c-64:c+36"
                                                    /> 
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgDataAdmissao" showDetail="true" autoUpdate="true" closable="true" />                                
                                    </div>
                                </div>

                                <div class="row-fluid">                                       
                                    <strong for="txtFuncao" class="font-color-green">
                                        Email pessoal:</strong>                                 
                                </div>
                                <div class="row-fluid" >
                                    <div class="span6">
                                        <p:inputText id="txt_email" style="width: 97%; height: 30px; "
                                                     value="#{servidorBean.servidor.email}"
                                                     maxlength="100"
                                                     />                                    
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgEmail" showDetail="true" autoUpdate="true" closable="true" />                                
                                    </div>
                                </div>


                                <div class="row-fluid">
                                    <strong for="txtPopulacao" class="font-color-green">
                                        Status <strong style="color:red">*</strong>:</strong> 
                                </div>
                                <div class="row-fluid">
                                    <div class="span6">
                                        <p:selectOneMenu id="sloStatus"  
                                                         style="width: 97%; color: black;"
                                                         value="#{servidorBean.servidor.status}">                                            
                                            <f:selectItem itemLabel="Ativo" itemValue="Ativo"
                                                          class="font-color-black"/>
                                            <f:selectItem itemLabel="Inativo" itemValue="Inativo" 
                                                          class="font-color-black"/>
                                            <f:selectItem itemLabel="Licença" itemValue="Licença"
                                                          class="font-color-black"/>
                                        </p:selectOneMenu>
                                    </div>
                                    <div class="span6">
                                        <p:messages for="msgStatus" showDetail="true" autoUpdate="true" closable="true"/>                                           
                                    </div>
                                </div>

                            </div>
                        </div>
                        <div class="pull-left">
                            <p:commandButton value="Voltar"                                                  
                                             update=":frmCadPessoal"
                                             style=" width: 100px;"
                                             icon="ui-icon-arrowthick-1-w"
                                             >
                                <f:actionListener binding="#{servidorBean.voltar()}"/>
                            </p:commandButton>
                        </div>
                    </div>                      
                </p:tab>
            </p:tabView>

        </h:form>                
        <p:confirmDialog global="true"
                         closable="false" 
                         message="O Cadastro foi salvo com sucesso!"  
                         header="Alerta" severity="alert" 
                         widgetVar="save"> 
            <h:form>
                <p:commandButton  id="buttonOK" 
                                  onclick="save.hide();" 
                                  value="OK" 
                                  ajax="false"
                                  action="#{servidorBean.irLista()}"
                                  >
                </p:commandButton> 
            </h:form>
        </p:confirmDialog>

        <p:dialog 
            modal="true"
            widgetVar="statusDialog"
            header="Aguarde..."
            appendTo="@(body)"
            draggable="false" closable="false" resizable="false">  
            <p:graphicImage value="/resources/img/loader.gif" />  
        </p:dialog>

        <p:confirmDialog 
            global="true"
            header="Confirmação"
            message="Você confirma o envio destas informações?" 
            id="confirmDialog"                               
            severity="alert" 
            widgetVar="confirmacao" 
            closable="false" 
            width="980"
            >
            <h:form id="formConfirm">
                <div class="row-fluid">                        
                    <div class="well-custom2">   
                        <div class="pull-left">
                            <div class="row-fluid">
                                <strong for="Nome" class="font-color-green">
                                    Nome<strong style="color:red">*</strong>: </strong> 
                                <h:outputText value="#{servidorBean.servidor.nome} "/>
                            </div>
                            <div class="row-fluid"> 
                                <strong for="CEP" class="font-color-green">
                                    CEP:</strong> 
                                <h:outputText value="#{servidorBean.servidor.cep} "/>                                
                            </div>
                            <div class="row-fluid"> 
                                <strong for="Endereco" class="font-color-green">
                                    Endereço: </strong> 
                                <h:outputText 
                                    value="#{servidorBean.servidor.endereco} "/> 
                            </div>
                            <div class="row-fluid">                                    
                                <strong for="Telefone" class="font-color-green">
                                    Telefone 1: </strong> 
                                <h:outputText value="#{servidorBean.servidor.telefone} " />                                
                            </div>
                            <div class="row-fluid">                                    
                                <strong for="Telefone2" class="font-color-green">
                                    Telefone 2: </strong> 
                                <h:outputText value="#{servidorBean.servidor.telefone2} " />                                
                            </div>
                            <div class="row-fluid">                                    
                                <strong for="Estado" class="font-color-green">
                                    Estado<strong style="color:red">*</strong>: </strong> 
                                <h:outputText value="#{servidorBean.servidor.uf.nome}" />                                 
                            </div>
                            <div class="row-fluid">                                    
                                <strong for="Municipio" class="font-color-green">
                                    Municipio<strong style="color:red">*</strong>: </strong> 
                                <h:outputText value="#{servidorBean.servidor.cidade.nome} " />                                
                            </div>
                            <div class="row-fluid">                                    
                                <strong for="Bairro" class="font-color-green">
                                    Bairro: </strong> 
                                <h:outputText value="#{servidorBean.servidor.bairro.nome} " />
                            </div>
                            <div class="row-fluid">                                    
                                <strong for="Escolaridade" class="font-color-green">
                                    Escolaridade: </strong> 
                                <h:outputText value="#{servidorBean.servidor.escolaridade} " />
                            </div>
                            <div class="row-fluid">                                    
                                <strong for="Sexo" class="font-color-green">
                                    Sexo: </strong> 
                                <h:outputText value="#{servidorBean.servidor.sexo} " />
                            </div>
                        </div>                                                                                

                        <div class="pull-left" style="margin-left: 14%">
                            <div class="row-fluid">                                    
                                <strong for="RG" class="font-color-green">
                                    RG<strong style="color:red">*</strong>: </strong> 
                                <h:outputText value="#{servidorBean.servidor.rg} "/>                                
                            </div>
                            <div class="row-fluid">                                    
                                <strong for="CPF" class="font-color-green">
                                    CPF<strong style="color:red">*</strong>: </strong> 
                                <h:outputText value="#{servidorBean.servidor.cpf} "/>                                
                            </div>
                            <div class="row-fluid">                                    
                                <strong for="PIS/PASEP" class="font-color-green">
                                    PIS/PASEP<strong style="color:red">*</strong>: </strong>                                 
                                <h:outputText value="#{servidorBean.servidor.pisPasep} "/>                                
                            </div>
                            <div class="row-fluid">                                    
                                <strong for="Título" class="font-color-green">
                                    Título<strong style="color:red">*</strong>: </strong> 
                                <h:outputText value="#{servidorBean.servidor.titulo} "/>
                            </div>
                            <div class="row-fluid">                                    
                                <strong for="Cargo" class="font-color-green">
                                    Cargo<strong style="color:red">*</strong>: </strong> 
                                <h:outputText value="#{servidorBean.servidor.cargo.nome} "/>                                
                            </div>
                            <div class="row-fluid">                                   
                                <strong for="TipoCargo" class="font-color-green">
                                    Tipo de cargo <strong style="color:red">*</strong>: </strong> 
                                <h:outputText value="#{servidorBean.servidor.tipoDeCargo.tipo} "/>                                
                            </div>
                            <div class="row-fluid">                                   
                                <strong for="Profissao" class="font-color-green">
                                    Profissao <strong style="color:red">*</strong>: </strong> 
                                <h:outputText value="#{servidorBean.servidor.profissao} "/>                                
                            </div>
                            <div class="row-fluid">                                    
                                <strong for="Status" class="font-color-green">
                                    Vínculo Previdência<strong style="color:red">*</strong>: </strong> 
                                <h:outputText value="#{servidorBean.servidor.vincPrevidencia} "/>
                            </div>
                        </div>
                        <div class="pull-right">
                            <div class="row-fluid">                                    
                                <strong for="RG" class="font-color-green">
                                    Unidade <strong style="color:red">*</strong>: </strong> 
                                <h:outputText value="#{servidorBean.servidor.unidade.sigla} "/>                                
                            </div>
                            <div class="row-fluid">                                    
                                <strong for="CPF" class="font-color-green">
                                    Setor <strong style="color:red">*</strong>: </strong> 
                                <h:outputText value="#{servidorBean.servidor.setor.sigla} "/>                                
                            </div>
                            <div class="row-fluid">                                    
                                <strong for="PIS/PASEP" class="font-color-green">
                                    Função <strong style="color:red">*</strong>: </strong>                                 
                                <h:outputText value="#{servidorBean.servidor.funcao} "/>                                
                            </div>
                            <div class="row-fluid">                                    
                                <strong for="DataAdm" class="font-color-green">
                                    Data de admissão <strong style="color:red">*</strong>: </strong> 
                                <h:outputText value="#{servidorBean.servidor.formataDataAdmissao} "/>
                            </div>
                            <div class="row-fluid">                                    
                                <strong for="Email" class="font-color-green">
                                    Email pessoal: </strong> 
                                <h:outputText value="#{servidorBean.servidor.email} "/>
                            </div>
                            <div class="row-fluid">                                    
                                <strong for="Título" class="font-color-green">
                                    Status <strong style="color:red">*</strong>: </strong> 
                                <h:outputText value="#{servidorBean.servidor.status} "/>
                            </div>
                        </div>

                    </div>                        
                    <div class="pull-left">   
                        <p:commandButton id="confirm" 
                                         onclick="PF('confirmacao').hide();"  
                                         value="Sim" 
                                         oncomplete="verify(args);"
                                         actionListener="#{servidorBean.salvar()}"
                                         update=":frmCadPessoal"
                                         />                          
                        <p:commandButton id="decline" value="Não" 
                                         onclick="PF('confirmacao').hide();" 
                                         >                                         
                        </p:commandButton>
                    </div>
                </div>
            </h:form>
        </p:confirmDialog>

        <p:confirmDialog 
            id="erros"
            global="true" closable="false" message="Não foi possível realizar esta operação"  
            header="Alerta" severity="alert" widgetVar="notfilled" 
            width="400"
            >  
            <h:form id="formCampos">
                <center>
                    <h:panelGrid>
                        <p:dataTable style="width: auto;" 
                                     emptyMessage="" 
                                     id="tabNomes" 
                                     var="campos"  
                                     value="#{servidorBean.campos}"                                         
                                     >                                                                                                                                                    
                            <p:column headerText="Verifique o(s) campo(s) abaixo">
                                <p:commandLink styleClass="link" value="#{campos.mensagem}" onclick="PF('notfilled').hide();"
                                               update=":frmCadPessoal"
                                               ajax="false">
                                    <f:setPropertyActionListener 
                                        value="#{campos.indiceTab}"
                                        target="#{servidorBean.indexTab}"/>
                                    <f:actionListener binding="#{servidorBean.limparLista()}"/>
                                </p:commandLink>
                            </p:column>
                        </p:dataTable>
                    </h:panelGrid>
                </center>
            </h:form>
        </p:confirmDialog>

        <p:confirmDialog global="true"
                         closable="false" 
                         message="Endereço não encontrado para o CEP informado!"  
                         header="Alerta" severity="alert" 
                         widgetVar="errorcep"> 
            <h:form>
                <p:commandButton  id="buttonOK" 
                                  onclick="errorcep.hide();" 
                                  value="OK" 
                                  ajax="false"
                                  update=":frmCadPessoal"
                                  >
                </p:commandButton> 
            </h:form>
        </p:confirmDialog>


    </ui:define>

</ui:composition>
